package com.atos.howl.chaos.pdm.service.impl;

import com.atos.howl.chaos.pdm.entity.User;
import com.atos.howl.chaos.pdm.mapper.UserMapper;
import com.atos.howl.chaos.pdm.service.LoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Howl-Xu
 * @version 1.0.0
 * @Description: 请描述一下这个类文件吧
 * @createTime 2020年02月07日 14:07:00
 */
@Service
public class LoginServiceImpl implements LoginService {

    @Resource
    private UserMapper userMapper;

    @Override
    public boolean isAccountExist(User user) {
        return isAccountExist(user.getAccount(),user.getPassword());
    }

    private boolean isAccountExist(String account,String password){
        int count = userMapper.getAccountNumber(account,password);
        if(count==1)
            return true;
        return false;
    }
}
